const { DataTypes } = require("sequelize");
const seq = require("../db/seq");

const User = seq.define("lotter_user", {
  username: {
    type: DataTypes.STRING,
    allowNull: false,
    unique: true,
    comment: "用户名，唯一",
  },
  password: {
    type: DataTypes.CHAR(64),
    allowNull: false,
    comment: "密码",
  },
  isAdmin:{
    type: DataTypes.BOOLEAN,
    defaultValue:0,
    allowNull: false,
    comment:"是否为管理员，0:不是、1:是"
  }
});

// 强制同步数据库 创建数据表
// User.sync({
//   force: true,
// })

module.exports = User


